3.156 \(\int \frac{\sec (c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx\)

Optimal. Leaf size=23 \[ \frac{x}{a}+\frac{i \log (\cos (c+d x))}{a d} \]

[Out]

x/a + (I*Log[Cos[c + d*x]])/(a*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0701351, antiderivative size = 23, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.103, Rules used = {3092, 3090, 3475} \[ \frac{x}{a}+\frac{i \log (\cos (c+d x))}{a d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]/(a*Cos[c + d*x] + I*a*Sin[c + d*x]),x]

[Out]

x/a + (I*Log[Cos[c + d*x]])/(a*d)

Rule 3092

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> Dist[a^n*b^n, Int[Cos[c + d*x]^m/(b*Cos[c + d*x] + a*Sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, m},
x] && EqQ[a^2 + b^2, 0] && ILtQ[n, 0]

Rule 3090

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Sym
bol] :> Int[ExpandTrig[cos[c + d*x]^m*(a*cos[c + d*x] + b*sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d}, x] &&
 IntegerQ[m] && IGtQ[n, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\sec (c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx &=-\frac{i \int \sec (c+d x) (i a \cos (c+d x)+a \sin (c+d x)) \, dx}{a^2}\\ &=-\frac{i \int (i a+a \tan (c+d x)) \, dx}{a^2}\\ &=\frac{x}{a}-\frac{i \int \tan (c+d x) \, dx}{a}\\ &=\frac{x}{a}+\frac{i \log (\cos (c+d x))}{a d}\\ \end{align*}

Mathematica [A]  time = 0.0651584, size = 23, normalized size = 1. \[ \frac{i \log (\cos (c+d x))+c+d x}{a d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]/(a*Cos[c + d*x] + I*a*Sin[c + d*x]),x]

[Out]

(c + d*x + I*Log[Cos[c + d*x]])/(a*d)

________________________________________________________________________________________

Maple [A]  time = 0.121, size = 22, normalized size = 1. \begin{align*}{\frac{-i\ln \left ( i\tan \left ( dx+c \right ) +1 \right ) }{ad}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x)

[Out]

-I/d/a*ln(I*tan(d*x+c)+1)

________________________________________________________________________________________

Maxima [B]  time = 1.1681, size = 136, normalized size = 5.91 \begin{align*} -\frac{-\frac{i \, \log \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} - \frac{i \, \log \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} + \frac{i \, \log \left (-\frac{2 i \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac{\sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1\right )}{a}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="maxima")

[Out]

-(-I*log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a - I*log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a + I*log(-2*I*si
n(d*x + c)/(cos(d*x + c) + 1) + sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 1)/a)/d

________________________________________________________________________________________

Fricas [A]  time = 0.492848, size = 65, normalized size = 2.83 \begin{align*} \frac{2 \, d x + i \, \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="fricas")

[Out]

(2*d*x + I*log(e^(2*I*d*x + 2*I*c) + 1))/(a*d)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [B]  time = 1.14518, size = 80, normalized size = 3.48 \begin{align*} -\frac{\frac{2 i \, \log \left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - i\right )}{a} - \frac{i \, \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac{i \, \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right )}{a}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="giac")

[Out]

-(2*I*log(tan(1/2*d*x + 1/2*c) - I)/a - I*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a - I*log(abs(tan(1/2*d*x + 1/2*c
) - 1))/a)/d